import Context from "./Context";
import Child from "./Child";
import { createContext } from "react";

// console.log(Context)

const ThemeContext = createContext(null);

export default function Parent()
{
    return (
        <>
            {/* 
                React的useContext是用于在函数组件中消费Context的Hook，它解决了组件树深层级数据传递的难题 跨组件
            */}

            <h1>123</h1>

            <Context.Provider value={{background: 'red'}}>
                <Child />
            </Context.Provider>
        </>
    )
}